package com.hd.service;

import java.util.Date;

import com.hd.common.DataPage;
import com.hd.persistence.model.AcceptTreatmentCase;
import com.hd.persistence.model.ActualizeProject;
import com.hd.persistence.model.Appraisal;
import com.hd.persistence.model.AssignRecord;
import com.hd.persistence.model.PartUsage;
import com.hd.persistence.model.RepairReport;
import com.hd.persistence.model.ReturnRecord;
import com.hd.utils.HdException;

/** 提供机器购买后维修流程所需的方法
 * 受理单、调派记录、维修报告、零件使用、维修实施项目、回访单、客户评价的增、删、查、改
 * @author Administrator
 *
 */
public interface RepairManager {

	////////////////////受理单////////////////////
	
	/** 保存、更新实体
	 * @param acceptTreatmentCase
	 * @throws HdException
	 */
	public void saveAcceptTreatmentCase(AcceptTreatmentCase acceptTreatmentCase) throws HdException;
	
	/** 根据标识删除实体
	 * @param acceptTreatmentCaseId
	 * @throws HdException
	 */
	public void deleteAcceptTreatmentCase(Long acceptTreatmentCaseId) throws HdException;
	
	/** 根据标识获取实体
	 * @param acceptTreatmentCaseId
	 * @return
	 * @throws HdException
	 */
	public AcceptTreatmentCase getAcceptTreatmentCase(Long acceptTreatmentCaseId) throws HdException;
	
	/** 根据条件分页查询
	 * @param unitName
	 * @param acceptTreatmenter
	 * @param acceptTreatmentTime
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<AcceptTreatmentCase> pageQueryAcceptTreatmentCases(String unitName, String acceptTreatmenter, Date acceptTreatmentTime, int pageNo, int pageSize) throws HdException;
	
	////////////////////实施项目////////////////////
	
	/** 保存、更新实体
	 * @param actualizeProject
	 * @throws HdException
	 */
	public void saveActualizeProject(ActualizeProject actualizeProject) throws HdException;
	
	/** 根据标识删除实体
	 * @param actualizeProjectId
	 * @throws HdException
	 */
	public void deleteActualizeProject(Long actualizeProjectId) throws HdException;
	
	/** 根据标识获取实体
	 * @param actualizeProjectId
	 * @return
	 * @throws HdException
	 */
	public ActualizeProject getActualizeProject(Long actualizeProjectId) throws HdException;
	
	/** 分页查询实施项目
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<ActualizeProject> pageQueryActualizeProjects(int pageNo, int pageSize) throws HdException;
	
	////////////////////客户评价////////////////////
	
	/** 保存、更新实体
	 * @param appraisal
	 * @throws HdException
	 */
	public void saveAppraisal(Appraisal appraisal) throws HdException;
	
	/** 根据标识删除实体
	 * @param appraisalId
	 * @throws HdException
	 */
	public void deleteAppraisal(Long appraisalId) throws HdException;
	
	/** 根据标识获取实体
	 * @param appraisalId
	 * @return
	 * @throws HdException
	 */
	public Appraisal getAppraisal(Long appraisalId) throws HdException;
	
	/** 分页查询客户评价
	 * @param pageNo 一个int，从1开始
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<Appraisal> pageQueryAppraisals(int pageNo, int pageSize) throws HdException;
	
	////////////////////调派单////////////////////
	
	/** 保存、更新实体
	 * @param assignRecord
	 * @throws HdException
	 */
	public void saveAssignRecord(AssignRecord assignRecord) throws HdException;
	
	/** 根据标识删除实体
	 * @param assignRecordId
	 * @throws HdException
	 */
	public void deleteAssignRecord(Long assignRecordId) throws HdException;
	
	/** 根据标识获取实体
	 * @param assignRecordId
	 * @return
	 * @throws HdException
	 */
	public AssignRecord getAssignRecord(Long assignRecordId) throws HdException;
	
	/** 分页查询调派单
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<AssignRecord> pageQuryAssignRecords(int pageNo, int pageSize) throws HdException;
	
	/** 根据条件查询调派记录
	 * @param unitName
	 * @param unitForShort
	 * @param machineModel
	 * @param repairman
	 * @param workday
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	public DataPage<AssignRecord> pageQueryAssignRecords(String unitName, String unitForShort, String machineModel, String repairman, Date workday, int pageNo, int pageSize) throws HdException;
	
	////////////////////零件使用////////////////////
	
	/** 保存、更新实体
	 * @param partUsage
	 * @throws HdException
	 */
	public void savePartUsage(PartUsage partUsage) throws HdException;
	
	/** 根据标识删除实体
	 * @param partUsageId
	 * @throws HdException
	 */
	public void deletePartUsage(Long partUsageId) throws HdException;
	
	/** 根据标识获取实体
	 * @param partUsageId
	 * @return
	 * @throws HdException
	 */
	public PartUsage getPartUsage(Long partUsageId) throws HdException;
	
	/** 分页查询零件使用
	 * @param pageNo 一个int，从1开始
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<PartUsage> pageQueryPartUsages(int pageNo, int pageSize) throws HdException;
	
	////////////////////维修报告////////////////////
	
	/** 保存、更新实体
	 * @param repairReport
	 * @throws HdException
	 */
	public void saveRepairReport(RepairReport repairReport) throws HdException;
	
	/** 根据标识删除实体
	 * @param repairReportId
	 * @throws HdException
	 */
	public void deleteRepairReport(Long repairReportId) throws HdException;
	
	/** 根据标识获取实体
	 * @param repairReportId
	 * @return
	 * @throws HdException
	 */
	public RepairReport getRepairReport(Long repairReportId) throws HdException;
	
	/** 分页查询维修报告书
	 * @param pageNo 一个int，从1开始
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<RepairReport> pageQueryRepairReports(int pageNo, int pageSize) throws HdException;
	
	/** 根据条件分页查询维修报告书
	 * @param repairDate
	 * @param repairman
	 * @param unitName
	 * @param category
	 * @param machineNo
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	public DataPage<RepairReport> pageQueryRepairReports(Date repairDate, String repairman, String unitName, Integer category, String machineNo, int pageNo, int pageSize) throws HdException;
		
	
	////////////////////回访单////////////////////
	
	/** 保存、更新实体
	 * @param returnRecord
	 * @throws HdException
	 */
	public void saveReturnRecord(ReturnRecord returnRecord) throws HdException;
	
	/** 根据标识删除实体
	 * @param returnRecordId
	 * @throws HdException
	 */
	public void deleteReturnRecord(Long returnRecordId) throws HdException;
	
	/** 根据标识获取实体
	 * @param returnRecordId
	 * @return
	 * @throws HdException
	 */
	public ReturnRecord getReturnRecord(Long returnRecordId) throws HdException;
	
	/** 分页查询回访记录
	 * @param pageNo 一个int，从1开始
	 * @param pageSize
	 * @return
	 * @throws HdException
	 */
	public DataPage<ReturnRecord> pageQueryReturnRecords(int pageNo, int pageSize) throws HdException;
	
	/** 根据条件分页查询回访记录
	 * @param unitName
	 * @param machineModel
	 * @param thisTimeRepairman
	 * @param thisTimeRepairDate
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	public DataPage<ReturnRecord> pageQueryReturnRecords(String unitName, String machineModel, String thisTimeRepairman, Date thisTimeRepairDate, int pageNo, int pageSize) throws HdException;
		
	
}
